<%@page contentType="text/html;charset=UTF-8"%>
<%@ page import="whf.framework.web.Constants"%>
<%@ page import="whf.survey.entity.SurveyTopic" %>

<%@taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic"%>
<%@taglib uri="/WEB-INF/tlds/framework.tld" prefix="framework"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><framework:attr source="STRUTS-META" attr="name" /></title>
<jsp:include page="/common/inc/select.jsp" />
</head>
<%
java.util.Map topicAnswers = (java.util.Map)request.getAttribute("topicAnswers");
%>
<body>
<html:form action='<%=  (String)request.getAttribute(Constants.STRUTS_PATH) %>' method="post">
<html:hidden property="webMethod" value="answer" />
<html:hidden property="id" />
<framework:ext />
<framework:table pkStyle="" hideTitleRow="true" boClassName="whf.survey.entity.SurveyTopic" dataSourceName="topics" id="answers" cacheTableAttributes="false">
	<framework:caption><span class="whf_object_title">"<framework:attr source="surveySurveyForm" attr="name" />"<framework:attr source="STRUTS-META" attr="name" /></span></framework:caption>
	<framework:column property="id" displayTitle="答案">
		<table width='100%' cellspacing='0' cellpadding='0'>
			<tr bgcolor='#EFEFEF'>
				<TD width='5%'><b>主题</b></TD><TD width='*%'>${name}</TD>
				<TD width='5%'><b>类型</b></TD><TD width='10%'>${choiceType.name}</TD>
			</tr>
			<tr bgcolor='#EFEFEF'>
				<TD width='5%'><b>说明</b></TD><TD colspan="3">${remarks}</TD>
			</tr>
		</table>
		<%
		SurveyTopic topic = (SurveyTopic)request.getAttribute("currentRow");
		String topicType = topic.getChoiceType();
		java.util.List answers = (java.util.List)topicAnswers.get(topic);
		
		request.setAttribute("topicType", topicType);
		request.setAttribute("answers", answers);
		%>
		<logic:equal name="topicType" value="00">
			<framework:table id="1" hideTitleRow="true" dataSourceName="answers" pageSize="1000">
				<framework:column property="answer" displayTitle="答案"></framework:column>
			</framework:table>
		</logic:equal>
		<logic:notEqual name="topicType" value="00">
			<framework:table id="2" pkStyle="" hideTitleRow="true" dataSourceName="answers" pageSize="1000">
				<framework:column property="id" displayTitle="答案">
				<table width="100%">
					<tr>
						<td width="7%">${choice.name}</td>
						<td width="3%" align='right'>${count}</td>
						<td width="$percentage2%" bgcolor="#BBBBEE" align='center'></td>
						<td width="*%">${percentage2}%</td>
					</tr>
				</table>
				</framework:column>
			</framework:table>
		</logic:notEqual>
	</framework:column>
</framework:table>

<input type='button' value="返回" onclick="window.history.back()">

</html:form>

</body>
</html> 